<?php

?>

<div class="order_bd mt10">
    <table class="orders table">
        <thead>
        <tr>
            <th >订单号</th>
            <th >订单商品</th>
            <th >收货人</th>
            <th >订单金额</th>
            <th >下单时间</th>
            <th >订单状态</th>
            <th >操作</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($models as $model):?>
            <tr>
                <td><a href=""><?=$model->trade_no?></a></td>
                <td><a href="">
                        <?php
                        $preUrl = Yii::$app->params['imgUrl'];
                        foreach ($model->orderDetail as $detail){
                            echo \yii\helpers\Html::img($preUrl.$detail->logo,['style'=>'width:50px;']);
                        }
                        ?>
                    </a></td>
                <td><?=$model->name?></td>
                <td>￥<?=$model->price?> <?=$model->pay_type_name?></td>
                <td><?=date('y-m-d h:m:s',$model->create_time)?></td>
                <td><?php

                    echo \frontend\models\Order::$orderStatus[$model->status];
                    if($model->status==1){
                        echo \yii\helpers\Html::a(' 支付去',['order/pay-by-wechat','id'=>$model->id],['style'=>'color:red']);
                    }
                    ?></td>
                <td><a href="">查看</a> | <a href="">删除</a></td>
            </tr>
        <?php endforeach;?>

        </tbody>
    </table>
</div>